package com.my.chapter11;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class practice17 {
    public static void main(String[] args) {
        Map<String,Gerbil> m = new HashMap<String,Gerbil>();
        m.put("FirstPeople",new Gerbil(1));
        m.put("SecoundPeople",new Gerbil(2));
        m.put("ThirdPeople",new Gerbil(3));
        Iterator<String> it = m.keySet().iterator();
        while(it.hasNext()){
            String s = it.next();
            Gerbil g = m.get(s);
            System.out.print(s + " ");
            g.hop();
        }
    }
}
